<template>
  <!-- 设置说明 -->
  <el-dialog :title="title+'说明'" :visible="value" width="600px" custom-class="dialog-box" @open="onOpen" @close="onClose" :close-on-click-modal="false" :append-to-body="true">
    <el-input v-model="remark" type="textarea" :rows="2" style="width:100%"></el-input>
    <span slot="footer">
      <el-button type="primary" @click="onSubmitExplain">确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
export default {
  props: ["value", "curItem"],
  data() {
    return {
      remark: "",
      title: ""
    };
  },
  methods: {
    onSubmitExplain() {
      let th = this;
      th.curItem.remark = th.remark;
      th.onClose();
    },
    onOpen() {
      let th = this;
      th.$nextTick(function() {
        th.remark = th.curItem.remark;
        th.title = th.curItem.drugName;
      });
    },
    onClose() {
      let th = this;
      th.$emit("input", false);
    }
  }
};
</script>
